home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / include / gtk-2.0 / gtk / gtkclipboard.h < prev    next >
Encoding:
C/C++ Source or Header  |  2006-04-25  |  5.5 KB  |  131 lines

  1. /* GTK - The GIMP Toolkit
  2.  * Copyright (C) 2000 Red Hat, Inc.
  3.  *
  4.  * This library is free software; you can redistribute it and/or
  5.  * modify it under the terms of the GNU Lesser General Public
  6.  * License as published by the Free Software Foundation; either
  7.  * version 2 of the License, or (at your option) any later version.
  8.  *
  9.  * This library is distributed in the hope that it will be useful,
  10.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  12.  * Lesser General Public License for more details.
  13.  *
  14.  * You should have received a copy of the GNU Lesser General Public
  15.  * License along with this library; if not, write to the
  16.  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  17.  * Boston, MA 02111-1307, USA.
  18.  *
  19.  * Global clipboard abstraction. 
  20.  */
  21.  
  22. #ifndef __GTK_CLIPBOARD_H__
  23. #define __GTK_CLIPBOARD_H__
  24.  
  25. #include <gtk/gtkselection.h>
  26.  
  27. G_BEGIN_DECLS
  28.  
  29. #define GTK_TYPE_CLIPBOARD            (gtk_clipboard_get_type ())
  30. #define GTK_CLIPBOARD(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_CLIPBOARD, GtkClipboard))
  31. #define GTK_IS_CLIPBOARD(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_CLIPBOARD))
  32.  
  33. typedef void (* GtkClipboardReceivedFunc)        (GtkClipboard     *clipboard,
  34.                               GtkSelectionData *selection_data,
  35.                               gpointer          data);
  36. typedef void (* GtkClipboardTextReceivedFunc)    (GtkClipboard     *clipboard,
  37.                               const gchar      *text,
  38.                               gpointer          data);
  39. typedef void (* GtkClipboardImageReceivedFunc)   (GtkClipboard     *clipboard,
  40.                           GdkPixbuf        *pixbuf,
  41.                           gpointer          data);
  42. typedef void (* GtkClipboardTargetsReceivedFunc) (GtkClipboard     *clipboard,
  43.                               GdkAtom          *atoms,
  44.                           gint              n_atoms,
  45.                               gpointer          data);
  46.  
  47. /* Should these functions have GtkClipboard *clipboard as the first argument?
  48.  * right now for ClearFunc, you may have trouble determining _which_ clipboard
  49.  * was cleared, if you reuse your ClearFunc for multiple clipboards.
  50.  */
  51. typedef void (* GtkClipboardGetFunc)          (GtkClipboard     *clipboard,
  52.                            GtkSelectionData *selection_data,
  53.                            guint             info,
  54.                            gpointer          user_data_or_owner);
  55. typedef void (* GtkClipboardClearFunc)        (GtkClipboard     *clipboard,
  56.                            gpointer          user_data_or_owner);
  57.  
  58. GType         gtk_clipboard_get_type (void) G_GNUC_CONST;
  59.  
  60. GtkClipboard *gtk_clipboard_get_for_display (GdkDisplay   *display,
  61.                          GdkAtom       selection);
  62. #ifndef GDK_MULTIHEAD_SAFE
  63. GtkClipboard *gtk_clipboard_get             (GdkAtom       selection);
  64. #endif
  65.  
  66. GdkDisplay   *gtk_clipboard_get_display     (GtkClipboard *clipboard);
  67.  
  68.  
  69. gboolean gtk_clipboard_set_with_data  (GtkClipboard          *clipboard,
  70.                        const GtkTargetEntry  *targets,
  71.                        guint                  n_targets,
  72.                        GtkClipboardGetFunc    get_func,
  73.                        GtkClipboardClearFunc  clear_func,
  74.                        gpointer               user_data);
  75. gboolean gtk_clipboard_set_with_owner (GtkClipboard          *clipboard,
  76.                        const GtkTargetEntry  *targets,
  77.                        guint                  n_targets,
  78.                        GtkClipboardGetFunc    get_func,
  79.                        GtkClipboardClearFunc  clear_func,
  80.                        GObject               *owner);
  81. GObject *gtk_clipboard_get_owner      (GtkClipboard          *clipboard);
  82. void     gtk_clipboard_clear          (GtkClipboard          *clipboard);
  83. void     gtk_clipboard_set_text       (GtkClipboard          *clipboard,
  84.                        const gchar           *text,
  85.                        gint                   len);
  86. void     gtk_clipboard_set_image      (GtkClipboard          *clipboard,
  87.                        GdkPixbuf             *pixbuf);
  88.  
  89. void gtk_clipboard_request_contents (GtkClipboard                    *clipboard,
  90.                      GdkAtom                          target,
  91.                      GtkClipboardReceivedFunc         callback,
  92.                      gpointer                         user_data);
  93. void gtk_clipboard_request_text     (GtkClipboard                    *clipboard,
  94.                      GtkClipboardTextReceivedFunc     callback,
  95.                      gpointer                         user_data);
  96. void gtk_clipboard_request_image    (GtkClipboard                    *clipboard,
  97.                      GtkClipboardImageReceivedFunc    callback,
  98.                      gpointer                         user_data);
  99. void gtk_clipboard_request_targets  (GtkClipboard                    *clipboard,
  100.                      GtkClipboardTargetsReceivedFunc  callback,
  101.                      gpointer                         user_data);
  102.  
  103. GtkSelectionData *gtk_clipboard_wait_for_contents (GtkClipboard  *clipboard,
  104.                            GdkAtom        target);
  105. gchar *           gtk_clipboard_wait_for_text     (GtkClipboard  *clipboard);
  106. GdkPixbuf *       gtk_clipboard_wait_for_image    (GtkClipboard  *clipboard);
  107. gboolean          gtk_clipboard_wait_for_targets  (GtkClipboard  *clipboard,
  108.                            GdkAtom      **targets,
  109.                            gint          *n_targets);
  110.  
  111. gboolean gtk_clipboard_wait_is_text_available   (GtkClipboard *clipboard);
  112. gboolean gtk_clipboard_wait_is_image_available  (GtkClipboard *clipboard);
  113. gboolean gtk_clipboard_wait_is_target_available (GtkClipboard *clipboard,
  114.                          GdkAtom       target);
  115.  
  116.  
  117. void gtk_clipboard_set_can_store (GtkClipboard         *clipboard,
  118.                   const GtkTargetEntry *targets,
  119.                   gint                  n_targets);
  120.  
  121. void gtk_clipboard_store         (GtkClipboard   *clipboard);
  122.   
  123. /* private */
  124. void     _gtk_clipboard_handle_event    (GdkEventOwnerChange *event);
  125.  
  126. void     _gtk_clipboard_store_all       (void);
  127.   
  128. G_END_DECLS
  129.  
  130. #endif /* __GTK_CLIPBOARD_H__ */
  131.